/* 苹果风格的智能分析与推荐模块样式 */

/* 主面板容器 */
.apple-analysis-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  margin: 16px;
  overflow: hidden;
  animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 头部区域 */
.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.analysis-title-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analysis-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.analysis-icon svg {
  width: 20px;
  height: 20px;
}

.analysis-title-content h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.2;
}

.analysis-subtitle {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: #64748b;
  font-weight: 400;
}

.apple-close-button {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #64748b;
}

.apple-close-button:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.apple-close-button svg {
  width: 16px;
  height: 16px;
}

/* 内容区域 */
.analysis-content {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

/* 卡片样式 */
.analysis-card {
  background: white;
  border-radius: 12px;
  box-shadow: 
    0 1px 3px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s ease;
}

.analysis-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(59, 130, 246, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.card-icon svg {
  width: 16px;
  height: 16px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.card-content {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 摘要卡片特殊样式 */
.summary-card .card-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.summary-text {
  color: #334155;
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  flex: 1;
}

/* 洞察卡片特殊样式 */
.insights-card .card-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.insight-section {
  margin-bottom: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.insight-section:last-child {
  margin-bottom: 0;
}

.insight-label {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.keywords-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.keyword-tag {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.2s ease;
}

.keyword-tag:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-badge {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(245, 158, 11, 0.2);
  transition: all 0.2s ease;
}

.tag-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

/* 推荐卡片特殊样式 */
.recommendations-card .card-icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.recommendation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.recommendation-item:hover {
  background: #f1f5f9;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recommendation-content {
  flex: 1;
}

.recommendation-title {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.recommendation-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.relevance-score {
  font-size: 12px;
  color: #64748b;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
}

.recommendation-rank {
  font-size: 12px;
  color: #8b5cf6;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
}

.recommendation-arrow {
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.recommendation-item:hover .recommendation-arrow {
  color: #8b5cf6;
  transform: translateX(2px);
}

.recommendation-arrow svg {
  width: 16px;
  height: 16px;
}

/* 加载状态 */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px;
  color: #64748b;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e2e8f0;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px;
  color: #94a3b8;
  text-align: center;
}

.empty-state svg {
  width: 32px;
  height: 32px;
  opacity: 0.5;
}

.empty-state span {
  font-size: 14px;
  line-height: 1.4;
}

.empty-text {
  color: #94a3b8;
  font-style: italic;
}

/* 动画效果 */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (min-width: 768px) {
  .analysis-content {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .summary-card {
    grid-column: 1 / 2;
  }
  
  .insights-card {
    grid-column: 2 / 3;
  }
  
  .insights-card,
  .recommendations-card {
    min-height: 300px;
  }
}

@media (min-width: 1024px) {
  .analysis-content {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
  }
  
  .summary-card {
    grid-column: 1 / 2;
  }
  
  .insights-card {
    grid-column: 2 / 3;
  }
  
  .recommendations-card {
    grid-column: 3 / 4;
  }
  
  .insights-card,
  .recommendations-card {
    min-height: 280px;
  }
}

@media (min-width: 1200px) {
  .analysis-content {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .summary-card {
    grid-column: 1 / 2;
  }
  
  .insights-card {
    grid-column: 2 / 3;
  }
  
  .recommendations-card {
    grid-column: 3 / 4;
  }
  
  .insights-card,
  .recommendations-card {
    min-height: 260px;
  }
}

@media (min-width: 1400px) {
  .analysis-content {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
    max-width: 1600px;
  }
  
  .summary-card {
    grid-column: 1 / 2;
  }
  
  .insights-card {
    grid-column: 2 / 3;
  }
  
  .recommendations-card {
    grid-column: 3 / 4;
  }
  
  .insights-card,
  .recommendations-card {
    min-height: 240px;
  }
}

@media (min-width: 1600px) {
  .analysis-content {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    max-width: 1800px;
  }
  
  .summary-card {
    grid-column: 1 / 2;
  }
  
  .insights-card {
    grid-column: 2 / 3;
  }
  
  .recommendations-card {
    grid-column: 3 / 4;
  }
  
  .insights-card,
  .recommendations-card {
    min-height: 220px;
  }
}

/* 宽屏下的内容优化 */
@media (min-width: 1200px) {
  .summary-text {
    font-size: 15px;
    line-height: 1.7;
    max-height: 250px;
  }
  
  .keyword-tag,
  .tag-badge {
    font-size: 14px;
    padding: 8px 14px;
  }
  
  .recommendation-title {
    font-size: 16px;
  }
  
  .recommendation-meta {
    font-size: 13px;
  }
  
  .insight-label {
    font-size: 15px;
  }
}

@media (min-width: 1400px) {
  .summary-text {
    font-size: 16px;
    line-height: 1.8;
    max-height: 300px;
  }
  
  .keyword-tag,
  .tag-badge {
    font-size: 15px;
    padding: 10px 16px;
  }
  
  .recommendation-title {
    font-size: 17px;
  }
  
  .recommendation-meta {
    font-size: 14px;
  }
  
  .insight-label {
    font-size: 16px;
  }
  
  .card-content {
    padding: 24px;
  }
  
  .card-header {
    padding: 20px 24px;
  }
}

@media (min-width: 1600px) {
  .summary-text {
    font-size: 17px;
    line-height: 1.9;
    max-height: 350px;
  }
  
  .keyword-tag,
  .tag-badge {
    font-size: 16px;
    padding: 12px 18px;
  }
  
  .recommendation-title {
    font-size: 18px;
  }
  
  .recommendation-meta {
    font-size: 15px;
  }
  
  .insight-label {
    font-size: 17px;
  }
  
  .card-content {
    padding: 28px;
  }
  
  .card-header {
    padding: 24px 28px;
  }
  
  .analysis-content {
    padding: 32px;
  }
}

/* 滚动条样式 */
.summary-text::-webkit-scrollbar {
  width: 6px;
}

.summary-text::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.summary-text::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.summary-text::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 苹果风格的按钮系统 */
.editor-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 0;
  margin: 0;
}

/* 按钮组样式 */
.action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 基础按钮样式 */
.apple-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-height: 40px;
}

.apple-button .button-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 主要按钮样式 */
.primary-button {
  background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
  background: linear-gradient(135deg, #0056CC 0%, #004499 100%);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
}

/* 次要按钮样式 */
.secondary-button {
  background: linear-gradient(135deg, #F2F2F7 0%, #E5E5EA 100%);
  color: #1C1C1E;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.secondary-button:hover {
  background: linear-gradient(135deg, #E5E5EA 0%, #D1D1D6 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.secondary-button:active {
  transform: translateY(0);
}

/* AI按钮样式 */
.ai-button {
  background: linear-gradient(135deg, #34C759 0%, #28A745 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.ai-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
  background: linear-gradient(135deg, #28A745 0%, #1E7E34 100%);
}

.ai-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(52, 199, 89, 0.3);
}

.ai-button:disabled {
  background: linear-gradient(135deg, #8E8E93 0%, #636366 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 4px rgba(142, 142, 147, 0.3);
}

/* 导出按钮样式 */
.export-button {
  background: linear-gradient(135deg, #FF9500 0%, #FF8C00 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
  padding-right: 20px;
}

.export-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
  background: linear-gradient(135deg, #FF8C00 0%, #FF7F00 100%);
}

.export-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(255, 149, 0, 0.3);
}

.export-button .dropdown-arrow {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.export-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* 图片按钮样式 */
.image-button {
  background: linear-gradient(135deg, #AF52DE 0%, #8E44AD 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(175, 82, 222, 0.3);
}

.image-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(175, 82, 222, 0.4);
  background: linear-gradient(135deg, #8E44AD 0%, #7D3C98 100%);
}

.image-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(175, 82, 222, 0.3);
}

/* 导出菜单样式 */
.export-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  z-index: 1000;
  margin-top: 4px;
  min-width: 160px;
}

.export-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #1C1C1E;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.export-menu-item:hover {
  background: #F2F2F7;
}

.export-menu-item .menu-icon {
  width: 16px;
  height: 16px;
  color: #8E8E93;
}

/* 文件选择信息 */
.file-selection-info {
  font-size: 12px;
  color: #8E8E93;
  margin-top: 4px;
  text-align: center;
}

/* 响应式布局优化 */
@media (max-width: 1200px) {
  .editor-actions {
    gap: 12px;
  }
  
  .action-group {
    gap: 6px;
  }
  
  .apple-button {
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .editor-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .action-group {
    justify-content: center;
  }
  
  .apple-button {
    justify-content: center;
    min-height: 44px;
  }
}

/* 全屏模式优化 */
.editor-container:fullscreen .editor-actions,
.editor-container:-webkit-full-screen .editor-actions {
  justify-content: center;
  max-width: 100%;
  padding: 0 20px;
}

.editor-container:fullscreen .action-group,
.editor-container:-webkit-full-screen .action-group {
  flex: 1;
  justify-content: center;
  max-width: 300px;
}

/* 按钮点击波纹效果 */
.apple-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.apple-button:active::before {
  width: 200px;
  height: 200px;
}

/* 导出下拉菜单定位 */
.export-dropdown {
  position: relative;
}

/* 编辑器头部优化 */
.editor-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.editor-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.back-button {
  background: linear-gradient(135deg, #F2F2F7 0%, #E5E5EA 100%);
  color: #1C1C1E;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-button:hover {
  background: linear-gradient(135deg, #E5E5EA 0%, #D1D1D6 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.title-input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 500;
  background: white;
  transition: all 0.2s ease;
  min-width: 200px;
}

.title-input:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* 全屏模式下的布局优化 */
.editor-container:fullscreen .editor-header,
.editor-container:-webkit-full-screen .editor-header {
  padding: 20px 40px;
  justify-content: center;
}

.editor-container:fullscreen .editor-nav,
.editor-container:-webkit-full-screen .editor-nav {
  justify-content: center;
  max-width: 800px;
  margin: 0 auto 20px auto;
}

.editor-container:fullscreen .title-input,
.editor-container:-webkit-full-screen .title-input {
  max-width: 400px;
  text-align: center;
}

/* 编辑器工具栏优化 */
.editor-toolbar-wrapper {
  margin: 0 16px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* 上传指示器优化 */
.upload-indicator {
  background: linear-gradient(135deg, #34C759 0%, #28A745 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  margin: 16px;
  box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* 顶部用户信息栏优化 */
.top-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 101;
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.user-avatar-small:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.logout-button {
  background: linear-gradient(135deg, #FF3B30 0%, #DC2626 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}
